package com.lsk.game.controller;

import com.lsk.game.helper.GameHelper;
import com.lsk.game.model.Game;
import com.lsk.game.model.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

@RestController
public class Controller {
	@GetMapping("/newGame")
	public String newGame(){
		String gameID = UUID.randomUUID().toString();
		GameHelper.newGame(gameID);
		return gameID;
	}
	@GetMapping("/getIdentity")
	public User getIdentity(Integer userID,String gameID){
		return GameHelper.getGame(gameID).getPlayer(userID);
	}
}
